﻿// JavaScript Document
     function findDimensions() //函数：获取尺寸
     {
	    $lh=$('.leftbody').height();
		$rh=$('.rightbody').height();
		if($lh>$rh)
		{$('.rightbody').css("height",$lh);}
		if($lh<$rh)
		{$('.leftbody').css("height",$rh);}
		
		$lh2=$(document).height()-124;
		{$('.leftbody_sz').css("height",$lh2);}
		$rh2=$('.rightbody_sz').height();
		if($lh2>$rh2)
		{$('.rightbody_sz').css("height",$lh2);}
		if($lh2<$rh2)
		{$('.leftbody_sz').css("height",$rh2);}
		
     }
     findDimensions();
     //调用函数，获取数值
     window.onresize=findDimensions;
	

$(document).ready(function(){
		$lh=$('.leftbody').height();
		$rh=$('.rightbody').height();
		if($lh>$rh)
		{$('.rightbody').css("height",$lh);}
		if($lh<$rh)
		{$('.leftbody').css("height",$rh);}
		
		$lh2=$(document).height()-124;
		{$('.leftbody_sz').css("height",$lh2);}
		$rh2=$('.rightbody_sz').height();
		if($lh2>$rh2)
		{$('.rightbody_sz').css("height",$lh2);}
		if($lh2<$rh2)
		{$('.leftbody_sz').css("height",$rh2);}
		
		
		$('a.anniu_time').click(function(){
				$('a.anniu_time').addClass("sel");
				$('a.anniu_team').removeClass("sel");
						   });
		$('a.anniu_team').click(function(){
				$('a.anniu_team').addClass("sel");
				$('a.anniu_time').removeClass("sel");
						   });
		
		$("a.anniu_show").click(function(){
	     $(".search_s_con").toggle();
								   });
		
		$(".search_s_con a").click(function(){								
	     $(".search_s_con").hide();
								   });
		
		$("a.anniu_sz").click(function(){
	     $(".sz_con").toggle();
								   });
		
		$(".sz_con a").click(function(){								
	     $(".sz_con").hide();
								   });
		
		$('.anniu_add').click(function(){
			$('.add_div').toggle();
			$('.yuan_g').toggle();
									   });
		
		$('.anniu_edit').click(function(){
			$('.edit_div').toggle();
			$('.yuan_g').toggle();
									   });
		
		$('.anniu_see').click(function(){
			$('.see_div').toggle();
			$('.yuan_g').toggle();
									   });
		
		$('.anniu_hf').click(function(){
			$('.hf_con').hide();						  
			$(this).next('.hf_con').toggle();
									   });
		
		$('.div_zf a').click(function(){
			$(this).children(".choice").toggle();
									  });
		
	   $('.text_search').focus(function(){
		        var $txt_value = $(this).val();
				if($txt_value=="查询日志")
				{ $(this).val("");}
										 });
		$('.text_search').blur(function(){
				var $txt_value= $(this).val();
				if($txt_value=="")
				{$(this).val("查询日志");}
										 });
		
		 $('.text_bf').focus(function(){
		        var $txt_value = $(this).val();
				if($txt_value=="请填写补发日志的原因")
				{ $(this).val("");}
										 });
		$('.text_bf').blur(function(){
				var $txt_value= $(this).val();
				if($txt_value=="")
				{$(this).val("请填写补发日志的原因");}
										 });
		
		
});

function inElement(elm, id) {
    return elm.id == id || $(elm).parents('#' + id).length > 0;
}
function inElmClass(elm, cls) {
	return $(elm).hasClass(cls) || $(elm).parents('.' + cls).length > 0;
}

$(document).ready(function(){
      $(document).click(function(e){
    if (!e) var e = window.event;
    var elm;
    if (e.srcElement) {
        elm = e.srcElement;
    } else {
        elm = e.target;
    }
				if (inElmClass(elm,'search_s_con') || inElmClass(elm,'anniu_show')) return;
			    if($(".search_s_con").is(":visible"))
				{$(".search_s_con").hide();}
								  });
						   
						  

      $(document).click(function(e){
    if (!e) var e = window.event;
    var elm;
    if (e.srcElement) {
        elm = e.srcElement;
    } else {
        elm = e.target;
    }
				if (inElmClass(elm,'sz_con') || inElmClass(elm,'anniu_sz')) return;
			    if($(".sz_con").is(":visible"))
				{$(".sz_con").hide();}
								  });
	  
	   $(document).click(function(e){
    if (!e) var e = window.event;
    var elm;
    if (e.srcElement) {
        elm = e.srcElement;
    } else {
        elm = e.target;
    }
				if (inElmClass(elm,'hf_con') || inElmClass(elm,'anniu_hf')) return;
			    if($(".hf_con").is(":visible"))
				{$(".hf_con").hide();}
								  });
	  
	  
						   
});


/*菜单栏的按钮弹出框*/
$(document).ready(function(){
		$(".anniu_fxx").click(function(){						 
			$( ".div_fxx" ).dialog({
					modal: true,
					width:500,
					buttons: {
                确定: function() {
                    $( this ).dialog( "close" );
                },
				取消: function() {
                    $( this ).dialog( "close" );
				}}
				})

			});
		
		$(".anniu_fxx_t").click(function(){						 
			$( ".div_fxx_t" ).dialog({
					modal: true,
					width:500,
					buttons: {
                确定: function() {
                    $( this ).dialog( "close" );
                },
				取消: function() {
                    $( this ).dialog( "close" );
				}}
				})

			});
		
		$(".anniu_ftz").click(function(){						 
			$( ".div_ftz" ).dialog({
					modal: true,
					width:500,
					buttons: {
                确定: function() {
                    $( this ).dialog( "close" );
                },
				取消: function() {
                    $( this ).dialog( "close" );
				}}
				})

			});
		
		$(".anniu_zf").click(function(){						 
			$( ".div_zf" ).dialog({
					modal: true,
					width:500,
					buttons: {
                确定: function() {
                    $( this ).dialog( "close" );
                },
				取消: function() {
                    $( this ).dialog( "close" );
				}}
				})

			});
						   });